﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MeshGenerator.Core.Collections
{
    public class ObservedList<T> : List<T>
    {
        public event EventHandler Changed;
        public ObservedList() : base() { }
        public ObservedList(int capacity) : base(capacity) { }
        new public void Add(T item)
        {
            base.Add(item);
            OnChanged();
        }
        void OnChanged()
        {
            if (Changed != null)
                Changed(this, new EventArgs());
        }
    }
}
